home *** CD-ROM | disk | FTP | other *** search
/ Belgian Amiga Club - ADF Collection / BS1 part 26.zip / BS1 part 26 / Aztec C v5.2a disk 4.adf / 204inc_h.lzh / intuition / intuition.h < prev    next >
C/C++ Source or Header  |  1991-03-14  |  52KB  |  1,362 lines

  1. #ifndef INTUITION_INTUITION_H
  2. #define INTUITION_INTUITION_H TRUE
  3. /*
  4. **  $Filename: intuition/intuition.h $
  5. **  $Release: 2.04 $
  6. **  $Revision: 36.49 $
  7. **  $Date: 91/02/22 $
  8. **
  9. **  Interface definitions for Intuition applications.
  10. **
  11. **  (C) Copyright 1985,1986,1987,1988,1989,1990 Commodore-Amiga, Inc.
  12. **        All Rights Reserved
  13. */
  14.  
  15. #ifndef EXEC_TYPES_H
  16. #include <exec/types.h>
  17. #endif
  18.  
  19. #ifndef GRAPHICS_GFX_H
  20. #include <graphics/gfx.h>
  21. #endif
  22.  
  23. #ifndef GRAPHICS_CLIP_H
  24. #include <graphics/clip.h>
  25. #endif
  26.  
  27. #ifndef GRAPHICS_VIEW_H
  28. #include <graphics/view.h>
  29. #endif
  30.  
  31. #ifndef GRAPHICS_RASTPORT_H
  32. #include <graphics/rastport.h>
  33. #endif
  34.  
  35. #ifndef GRAPHICS_LAYERS_H
  36. #include <graphics/layers.h>
  37. #endif
  38.  
  39. #ifndef GRAPHICS_TEXT_H
  40. #include <graphics/text.h>
  41. #endif
  42.  
  43. #ifndef EXEC_PORTS_H
  44. #include <exec/ports.h>
  45. #endif
  46.  
  47. #ifndef DEVICES_INPUTEVENT_H
  48. #include <devices/inputevent.h>
  49. #endif
  50.  
  51. #ifndef UTILITY_TAGITEM_H
  52. #include <utility/tagitem.h>
  53. #endif
  54.  
  55. /*
  56.  * NOTE:  intuition/iobsolete.h is included at the END of this file!
  57.  */
  58.  
  59. /* ======================================================================== */
  60. /* === Menu =============================================================== */
  61. /* ======================================================================== */
  62. struct Menu
  63. {
  64.     struct Menu *NextMenu;    /* same level */
  65.     WORD LeftEdge, TopEdge;    /* position of the select box */
  66.     WORD Width, Height;    /* dimensions of the select box */
  67.     UWORD Flags;        /* see flag definitions below */
  68.     BYTE *MenuName;        /* text for this Menu Header */
  69.     struct MenuItem *FirstItem; /* pointer to first in chain */
  70.  
  71.     /* these mysteriously-named variables are for internal use only */
  72.     WORD JazzX, JazzY, BeatX, BeatY;
  73. };
  74.  
  75.  
  76. /* FLAGS SET BY BOTH THE APPLIPROG AND INTUITION */
  77. #define MENUENABLED 0x0001    /* whether or not this menu is enabled */
  78.  
  79. /* FLAGS SET BY INTUITION */
  80. #define MIDRAWN 0x0100        /* this menu's items are currently drawn */
  81.  
  82.  
  83.  
  84.  
  85.  
  86.  
  87. /* ======================================================================== */
  88. /* === MenuItem =========================================================== */
  89. /* ======================================================================== */
  90. struct MenuItem
  91. {
  92.     struct MenuItem *NextItem;    /* pointer to next in chained list */
  93.     WORD LeftEdge, TopEdge;    /* position of the select box */
  94.     WORD Width, Height;        /* dimensions of the select box */
  95.     UWORD Flags;        /* see the defines below */
  96.  
  97.     LONG MutualExclude;        /* set bits mean this item excludes that */
  98.  
  99.     APTR ItemFill;        /* points to Image, IntuiText, or NULL */
  100.  
  101.     /* when this item is pointed to by the cursor and the items highlight
  102.      *    mode HIGHIMAGE is selected, this alternate image will be displayed
  103.      */
  104.     APTR SelectFill;        /* points to Image, IntuiText, or NULL */
  105.  
  106.     BYTE Command;        /* only if appliprog sets the COMMSEQ flag */
  107.  
  108.     struct MenuItem *SubItem;    /* if non-zero, points to MenuItem for submenu */
  109.  
  110.     /* The NextSelect field represents the menu number of next selected
  111.      *    item (when user has drag-selected several items)
  112.      */
  113.     UWORD NextSelect;
  114. };
  115.  
  116.  
  117. /* FLAGS SET BY THE APPLIPROG */
  118. #define CHECKIT        0x0001    /* set to indicate checkmarkable item */
  119. #define ITEMTEXT    0x0002    /* set if textual, clear if graphical item */
  120. #define COMMSEQ        0x0004    /* set if there's an command sequence */
  121. #define MENUTOGGLE    0x0008    /* set for toggling checks (else mut. exclude) */
  122. #define ITEMENABLED    0x0010    /* set if this item is enabled */
  123.  
  124. /* these are the SPECIAL HIGHLIGHT FLAG state meanings */
  125. #define HIGHFLAGS    0x00C0    /* see definitions below for these bits */
  126. #define HIGHIMAGE    0x0000    /* use the user's "select image" */
  127. #define HIGHCOMP    0x0040    /* highlight by complementing the selectbox */
  128. #define HIGHBOX        0x0080    /* highlight by "boxing" the selectbox */
  129. #define HIGHNONE    0x00C0    /* don't highlight */
  130.  
  131. /* FLAGS SET BY BOTH APPLIPROG AND INTUITION */
  132. #define CHECKED    0x0100    /* state of the checkmark */
  133.  
  134. /* FLAGS SET BY INTUITION */
  135. #define ISDRAWN        0x1000    /* this item's subs are currently drawn */
  136. #define HIGHITEM    0x2000    /* this item is currently highlighted */
  137. #define MENUTOGGLED    0x4000    /* this item was already toggled */
  138.  
  139.  
  140.  
  141.  
  142.  
  143. /* ======================================================================== */
  144. /* === Requester ========================================================== */
  145. /* ======================================================================== */
  146. struct Requester
  147. {
  148.     struct Requester *OlderRequest;
  149.     WORD LeftEdge, TopEdge;        /* dimensions of the entire box */
  150.     WORD Width, Height;            /* dimensions of the entire box */
  151.     WORD RelLeft, RelTop;        /* for Pointer relativity offsets */
  152.  
  153.     struct Gadget *ReqGadget;        /* pointer to a list of Gadgets */
  154.     struct Border *ReqBorder;        /* the box's border */
  155.     struct IntuiText *ReqText;        /* the box's text */
  156.     UWORD Flags;            /* see definitions below */
  157.  
  158.     /* pen number for back-plane fill before draws */
  159.     UBYTE BackFill;
  160.     /* Layer in place of clip rect    */
  161.     struct Layer *ReqLayer;
  162.  
  163.     UBYTE ReqPad1[32];
  164.  
  165.     /* If the BitMap plane pointers are non-zero, this tells the system
  166.      * that the image comes pre-drawn (if the appliprog wants to define
  167.      * its own box, in any shape or size it wants!);  this is OK by
  168.      * Intuition as long as there's a good correspondence between
  169.      * the image and the specified Gadgets
  170.      */
  171.     struct BitMap *ImageBMap;    /* points to the BitMap of PREDRAWN imagery */
  172.     struct Window *RWindow;    /* added.  points back to Window */
  173.  
  174.     struct Image  *ReqImage;    /* new for V36: drawn if USEREQIMAGE set */
  175.  
  176.     UBYTE ReqPad2[32];
  177. };
  178.  
  179.  
  180. /* FLAGS SET BY THE APPLIPROG */
  181. #define POINTREL    0x0001
  182.               /* if POINTREL set, TopLeft is relative to pointer
  183.                * for DMRequester, relative to window center
  184.                * for Request().
  185.                */
  186. #define PREDRAWN    0x0002
  187.     /* set if Requester.ImageBMap points to predrawn Requester imagery */
  188. #define NOISYREQ    0x0004
  189.     /* if you don't want requester to filter input       */
  190. #define SIMPLEREQ    0x0010
  191.     /* to use SIMPLEREFRESH layer (recommended)    */
  192.  
  193. /* New for V36        */
  194. #define USEREQIMAGE    0x0020
  195.     /*  render linked list ReqImage after BackFill
  196.      * but before gadgets and text
  197.      */
  198. #define NOREQBACKFILL    0x0040
  199.     /* don't bother filling requester with Requester.BackFill pen    */
  200.  
  201.  
  202. /* FLAGS SET BY INTUITION */
  203. #define REQOFFWINDOW    0x1000    /* part of one of the Gadgets was offwindow */
  204. #define REQACTIVE    0x2000    /* this requester is active */
  205. #define SYSREQUEST    0x4000    /* this requester caused by system */
  206. #define DEFERREFRESH    0x8000    /* this Requester stops a Refresh broadcast */
  207.  
  208.  
  209.  
  210.  
  211.  
  212.  
  213. /* ======================================================================== */
  214. /* === Gadget ============================================================= */
  215. /* ======================================================================== */
  216. struct Gadget
  217. {
  218.     struct Gadget *NextGadget;    /* next gadget in the list */
  219.  
  220.     WORD LeftEdge, TopEdge;    /* "hit box" of gadget */
  221.     WORD Width, Height;        /* "hit box" of gadget */
  222.  
  223.     UWORD Flags;        /* see below for list of defines */
  224.  
  225.     UWORD Activation;        /* see below for list of defines */
  226.  
  227.     UWORD GadgetType;        /* see below for defines */
  228.  
  229.     /* appliprog can specify that the Gadget be rendered as either as Border
  230.      * or an Image.  This variable points to which (or equals NULL if there's
  231.      * nothing to be rendered about this Gadget)
  232.      */
  233.     APTR GadgetRender;
  234.  
  235.     /* appliprog can specify "highlighted" imagery rather than algorithmic
  236.      * this can point to either Border or Image data
  237.      */
  238.     APTR SelectRender;
  239.  
  240.     struct IntuiText *GadgetText;   /* text for this gadget */
  241.  
  242.     /* MutualExclude, never implemented, is now declared obsolete.
  243.      * There are published examples of implementing a more general
  244.      * and practical exclusion in your applications.
  245.      *
  246.      * Starting with V36, this field is used to point to a hook
  247.      * for a custom gadget.
  248.      *
  249.      * Programs using this field for their own processing will
  250.      * continue to work, as long as they don't try the
  251.      * trick with custom gadgets.
  252.      */
  253.     LONG MutualExclude;  /* obsolete */
  254.  
  255.     /* pointer to a structure of special data required by Proportional,
  256.      * String and Integer Gadgets
  257.      */
  258.     APTR SpecialInfo;
  259.  
  260.     UWORD GadgetID;    /* user-definable ID field */
  261.     APTR UserData;    /* ptr to general purpose User data (ignored by In) */
  262. };
  263.  
  264.  
  265. /* --- Gadget.Flags values    --- */
  266. /* combinations in these bits describe the highlight technique to be used */
  267. #define GFLG_GADGHIGHBITS 0x0003
  268. #define GFLG_GADGHCOMP      0x0000  /* Complement the select box */
  269. #define GFLG_GADGHBOX      0x0001  /* Draw a box around the image */
  270. #define GFLG_GADGHIMAGE      0x0002  /* Blast in this alternate image */
  271. #define GFLG_GADGHNONE      0x0003  /* don't highlight */
  272.  
  273. #define GFLG_GADGIMAGE          0x0004  /* set if GadgetRender and SelectRender
  274.                    * point to an Image structure, clear
  275.                    * if they point to Border structures
  276.                    */
  277.  
  278. /* combinations in these next two bits specify to which corner the gadget's
  279.  *  Left & Top coordinates are relative.  If relative to Top/Left,
  280.  *  these are "normal" coordinates (everything is relative to something in
  281.  *  this universe).
  282.  *
  283.  * Gadget positions and dimensions are relative to the window or
  284.  * requester which contains the gadget
  285.  */
  286. #define GFLG_RELBOTTOM      0x0008  /* vert. pos. is relative to bottom edge */
  287. #define GFLG_RELRIGHT      0x0010  /* horiz. pos. is relative to right edge */
  288. #define GFLG_RELWIDTH      0x0020  /* width is relative to req/window    */
  289. #define GFLG_RELHEIGHT      0x0040  /* height is relative to req/window    */
  290.  
  291. #define GFLG_SELECTED      0x0080  /* you may initialize and look at this    */
  292.  
  293. /* the GFLG_DISABLED flag is initialized by you and later set by Intuition
  294.  * according to your calls to On/OffGadget().  It specifies whether or not
  295.  * this Gadget is currently disabled from being selected
  296.  */
  297. #define GFLG_DISABLED      0x0100
  298.  
  299. /* These flags specify the type of text field that Gadget.GadgetText
  300.  * points to.  In all normal (pre-V36) gadgets which you initialize
  301.  * this field should always be zero.  Some types of gadget objects
  302.  * created from classes will use these fields to keep track of
  303.  * types of labels/contents that different from IntuiText, but are
  304.  * stashed in GadgetText.
  305.  */
  306.  
  307. #define GFLG_LABELMASK      0x3000
  308. #define GFLG_LABELITEXT      0x0000  /* GadgetText points to IntuiText    */
  309. #define    GFLG_LABELSTRING  0x1000  /* GadgetText points to (UBYTE *)    */
  310. #define GFLG_LABELIMAGE      0x2000  /* GadgetText points to Image (object)    */
  311.  
  312. /* New for V37: GFLG_TABCYCLE */
  313. #define GFLG_TABCYCLE      0x0200  /* (string or custom) gadget participates in
  314.                    * cycling activation with Tab or Shift-Tab
  315.                    */
  316. /* New for V37: GFLG_STRINGEXTEND.  We discovered that V34 doesn't properly
  317.  * ignore the value we had chosen for the Gadget->Activation flag
  318.  * GACT_STRINGEXTEND.  NEVER SET THAT FLAG WHEN RUNNING UNDER V34.
  319.  * The Gadget->Flags bit GFLG_STRINGEXTEND is provided as a synonym which is
  320.  * safe under V34, and equivalent to GACT_STRINGEXTEND under V37.
  321.  * (Note that the two flags are not numerically equal)
  322.  */
  323. #define GFLG_STRINGEXTEND 0x0400  /* this String Gadget has StringExtend    */
  324.  
  325. /* ---    Gadget.Activation flag values    --- */
  326. /* Set GACT_RELVERIFY if you want to verify that the pointer was still over
  327.  * the gadget when the select button was released.  Will cause
  328.  * an IDCMP_GADGETUP message to be sent if so.
  329.  */
  330. #define GACT_RELVERIFY      0x0001
  331.  
  332. /* the flag GACT_IMMEDIATE, when set, informs the caller that the gadget
  333.  *  was activated when it was activated.  This flag works in conjunction with
  334.  *  the GACT_RELVERIFY flag
  335.  */
  336. #define GACT_IMMEDIATE      0x0002
  337.  
  338. /* the flag GACT_ENDGADGET, when set, tells the system that this gadget,
  339.  * when selected, causes the Requester to be ended.  Requesters
  340.  * that are ended are erased and unlinked from the system.
  341.  */
  342. #define GACT_ENDGADGET      0x0004
  343.  
  344. /* the GACT_FOLLOWMOUSE flag, when set, specifies that you want to receive
  345.  * reports on mouse movements while this gadget is active.
  346.  * You probably want to set the GACT_IMMEDIATE flag when using
  347.  * GACT_FOLLOWMOUSE, since that's the only reasonable way you have of
  348.  * learning why Intuition is suddenly sending you a stream of mouse
  349.  * movement events.  If you don't set GACT_RELVERIFY, you'll get at
  350.  * least one Mouse Position event.
  351.  */
  352. #define GACT_FOLLOWMOUSE  0x0008
  353.  
  354. /* if any of the BORDER flags are set in a Gadget that's included in the
  355.  * Gadget list when a Window is opened, the corresponding Border will
  356.  * be adjusted to make room for the Gadget
  357.  */
  358. #define GACT_RIGHTBORDER  0x0010
  359. #define GACT_LEFTBORDER      0x0020
  360. #define GACT_TOPBORDER      0x0040
  361. #define GACT_BOTTOMBORDER 0x0080
  362. #define GACT_BORDERSNIFF  0x8000  /* neither set nor rely on this bit    */
  363.  
  364. #define GACT_TOGGLESELECT 0x0100  /* this bit for toggle-select mode */
  365. #define GACT_BOOLEXTEND      0x2000  /* this Boolean Gadget has a BoolInfo    */
  366.  
  367. /* should properly be in StringInfo, but aren't    */
  368. #define GACT_STRINGLEFT      0x0000  /* NOTE WELL: that this has value zero    */
  369. #define GACT_STRINGCENTER 0x0200
  370. #define GACT_STRINGRIGHT  0x0400
  371. #define GACT_LONGINT      0x0800  /* this String Gadget is for Long Ints    */
  372. #define GACT_ALTKEYMAP      0x1000  /* this String has an alternate keymap    */
  373. #define GACT_STRINGEXTEND 0x2000  /* this String Gadget has StringExtend    */
  374.                   /* NOTE: NEVER SET GACT_STRINGEXTEND IF YOU
  375.                    * ARE RUNNING ON LESS THAN V36!  SEE
  376.                    * GFLG_STRINGEXTEND (ABOVE) INSTEAD
  377.                    */
  378.  
  379. #define GACT_ACTIVEGADGET 0x4000  /* this gadget is "active".  This flag
  380.                    * is maintained by Intuition, and you
  381.                    * cannot count on its value persisting
  382.                    * while you do something on your program's
  383.                    * task.  It can only be trusted by
  384.                    * people implementing custom gadgets
  385.                    */
  386.  
  387. /* note 0x8000 is used above (GACT_BORDERSNIFF);
  388.  * all Activation flags defined */
  389.  
  390. /* --- GADGET TYPES ------------------------------------------------------- */
  391. /* These are the Gadget Type definitions for the variable GadgetType
  392.  * gadget number type MUST start from one.  NO TYPES OF ZERO ALLOWED.
  393.  * first comes the mask for Gadget flags reserved for Gadget typing
  394.  */
  395. #define GTYP_GADGETTYPE    0xFC00    /* all Gadget Global Type flags (padded) */
  396. #define GTYP_SYSGADGET    0x8000    /* 1 = Allocated by the system, 0 = by app. */
  397. #define GTYP_SCRGADGET    0x4000    /* 1 = ScreenGadget, 0 = WindowGadget */
  398. #define GTYP_GZZGADGET    0x2000    /* 1 = for WFLG_GIMMEZEROZERO borders */
  399. #define GTYP_REQGADGET    0x1000    /* 1 = this is a Requester Gadget */
  400. /* system gadgets */
  401. #define GTYP_SIZING    0x0010
  402. #define GTYP_WDRAGGING    0x0020
  403. #define GTYP_SDRAGGING    0x0030
  404. #define GTYP_WUPFRONT    0x0040
  405. #define GTYP_SUPFRONT    0x0050
  406. #define GTYP_WDOWNBACK    0x0060
  407. #define GTYP_SDOWNBACK    0x0070
  408. #define GTYP_CLOSE    0x0080
  409. /* application gadgets */
  410. #define GTYP_BOOLGADGET    0x0001
  411. #define GTYP_GADGET0002    0x0002
  412. #define GTYP_PROPGADGET    0x0003
  413. #define GTYP_STRGADGET    0x0004
  414. #define GTYP_CUSTOMGADGET    0x0005
  415. #define GTYP_GTYPEMASK    0x0007    /* masks out to gadget class    */
  416.  
  417. /* This bit in GadgetType is reserved for undocumented internal use
  418.  * by the Gadget Toolkit, and cannot be used nor relied on by
  419.  * applications:    0x0100
  420.  */
  421.  
  422. /* ======================================================================== */
  423. /* === BoolInfo======================================================= */
  424. /* ======================================================================== */
  425. /* This is the special data needed by an Extended Boolean Gadget
  426.  * Typically this structure will be pointed to by the Gadget field SpecialInfo
  427.  */
  428. struct BoolInfo
  429. {
  430.     UWORD  Flags;    /* defined below */
  431.     UWORD  *Mask;    /* bit mask for highlighting and selecting
  432.              * mask must follow the same rules as an Image
  433.              * plane.  Its width and height are determined
  434.              * by the width and height of the gadget's
  435.              * select box. (i.e. Gadget.Width and .Height).
  436.              */
  437.     ULONG  Reserved;    /* set to 0    */
  438. };
  439.  
  440. /* set BoolInfo.Flags to this flag bit.
  441.  * in the future, additional bits might mean more stuff hanging
  442.  * off of BoolInfo.Reserved.
  443.  */
  444. #define BOOLMASK    0x0001    /* extension is for masked gadget */
  445.  
  446. /* ======================================================================== */
  447. /* === PropInfo =========================================================== */
  448. /* ======================================================================== */
  449. /* this is the special data required by the proportional Gadget
  450.  * typically, this data will be pointed to by the Gadget variable SpecialInfo
  451.  */
  452. struct PropInfo
  453. {
  454.     UWORD Flags;    /* general purpose flag bits (see defines below) */
  455.  
  456.     /* You initialize the Pot variables before the Gadget is added to
  457.      * the system.  Then you can look here for the current settings
  458.      * any time, even while User is playing with this Gadget.  To
  459.      * adjust these after the Gadget is added to the System, use
  460.      * ModifyProp();  The Pots are the actual proportional settings,
  461.      * where a value of zero means zero and a value of MAXPOT means
  462.      * that the Gadget is set to its maximum setting.
  463.      */
  464.     UWORD HorizPot;    /* 16-bit FixedPoint horizontal quantity percentage */
  465.     UWORD VertPot;    /* 16-bit FixedPoint vertical quantity percentage */
  466.  
  467.     /* the 16-bit FixedPoint Body variables describe what percentage of
  468.      * the entire body of stuff referred to by this Gadget is actually
  469.      * shown at one time.  This is used with the AUTOKNOB routines,
  470.      * to adjust the size of the AUTOKNOB according to how much of
  471.      * the data can be seen.  This is also used to decide how far
  472.      * to advance the Pots when User hits the Container of the Gadget.
  473.      * For instance, if you were controlling the display of a 5-line
  474.      * Window of text with this Gadget, and there was a total of 15
  475.      * lines that could be displayed, you would set the VertBody value to
  476.      *       (MAXBODY / (TotalLines / DisplayLines)) = MAXBODY / 3.
  477.      * Therefore, the AUTOKNOB would fill 1/3 of the container, and
  478.      * if User hits the Cotainer outside of the knob, the pot would
  479.      * advance 1/3 (plus or minus) If there's no body to show, or
  480.      * the total amount of displayable info is less than the display area,
  481.      * set the Body variables to the MAX.  To adjust these after the
  482.      * Gadget is added to the System, use ModifyProp();
  483.      */
  484.     UWORD HorizBody;        /* horizontal Body */
  485.     UWORD VertBody;        /* vertical Body */
  486.  
  487.     /* these are the variables that Intuition sets and maintains */
  488.     UWORD CWidth;    /* Container width (with any relativity absoluted) */
  489.     UWORD CHeight;    /* Container height (with any relativity absoluted) */
  490.     UWORD HPotRes, VPotRes;    /* pot increments */
  491.     UWORD LeftBorder;        /* Container borders */
  492.     UWORD TopBorder;        /* Container borders */
  493. };
  494.  
  495.  
  496. /* --- FLAG BITS ---------------------------------------------------------- */
  497. #define AUTOKNOB    0x0001    /* this flag sez:  gimme that old auto-knob */
  498. /* NOTE: if you do not use an AUTOKNOB for a proportional gadget,
  499.  * you are currently limited to using a single Image of your own
  500.  * design: Intuition won't handle a linked list of images as
  501.  * a proportional gadget knob.
  502.  */
  503.  
  504. #define FREEHORIZ    0x0002    /* if set, the knob can move horizontally */
  505. #define FREEVERT    0x0004    /* if set, the knob can move vertically */
  506. #define PROPBORDERLESS    0x0008    /* if set, no border will be rendered */
  507. #define KNOBHIT        0x0100    /* set when this Knob is hit */
  508. #define PROPNEWLOOK    0x0010    /* set this if you want to get the new
  509.                  * V36 look
  510.                  */
  511.  
  512. #define KNOBHMIN    6    /* minimum horizontal size of the Knob */
  513. #define KNOBVMIN    4    /* minimum vertical size of the Knob */
  514. #define MAXBODY        0xFFFF    /* maximum body value */
  515. #define MAXPOT            0xFFFF    /* maximum pot value */
  516.  
  517.  
  518. /* ======================================================================== */
  519. /* === StringInfo ========================================================= */
  520. /* ======================================================================== */
  521. /* this is the special data required by the string Gadget
  522.  * typically, this data will be pointed to by the Gadget variable SpecialInfo
  523.  */
  524. struct StringInfo
  525. {
  526.     /* you initialize these variables, and then Intuition maintains them */
  527.     UBYTE *Buffer;    /* the buffer containing the start and final string */
  528.     UBYTE *UndoBuffer;    /* optional buffer for undoing current entry */
  529.     WORD BufferPos;    /* character position in Buffer */
  530.     WORD MaxChars;    /* max number of chars in Buffer (including NULL) */
  531.     WORD DispPos;    /* Buffer position of first displayed character */
  532.  
  533.     /* Intuition initializes and maintains these variables for you */
  534.     WORD UndoPos;    /* character position in the undo buffer */
  535.     WORD NumChars;    /* number of characters currently in Buffer */
  536.     WORD DispCount;    /* number of whole characters visible in Container */
  537.     WORD CLeft, CTop;    /* topleft offset of the container */
  538.  
  539.     /* This unused field is changed to allow extended specification
  540.      * of string gadget parameters.  It is ignored unless the flag
  541.      * GACT_STRINGEXTEND is set in the Gadget's Activation field
  542.      * or the GFLG_STRINGEXTEND flag is set in the Gadget Flags field.
  543.      * (See GFLG_STRINGEXTEND for an important note)
  544.      */
  545.     /* struct Layer *LayerPtr;    --- obsolete --- */
  546.     struct StringExtend *Extension;
  547.  
  548.     /* you can initialize this variable before the gadget is submitted to
  549.      * Intuition, and then examine it later to discover what integer
  550.      * the user has entered (if the user never plays with the gadget,
  551.      * the value will be unchanged from your initial setting)
  552.      */
  553.     LONG LongInt;
  554.  
  555.     /* If you want this Gadget to use your own Console keymapping, you
  556.      * set the GACT_ALTKEYMAP bit in the Activation flags of the Gadget,
  557.      * and then set this variable to point to your keymap.  If you don't
  558.      * set the GACT_ALTKEYMAP, you'll get the standard ASCII keymapping.
  559.      */
  560.     struct KeyMap *AltKeyMap;
  561. };
  562.  
  563. /* ======================================================================== */
  564. /* === IntuiText ========================================================== */
  565. /* ======================================================================== */
  566. /* IntuiText is a series of strings that start with a location
  567.  *  (always relative to the upper-left corner of something) and then the
  568.  *  text of the string.  The text is null-terminated.
  569.  */
  570. struct IntuiText
  571. {
  572.     UBYTE FrontPen, BackPen;    /* the pen numbers for the rendering */
  573.     UBYTE DrawMode;        /* the mode for rendering the text */
  574.     WORD LeftEdge;        /* relative start location for the text */
  575.     WORD TopEdge;        /* relative start location for the text */
  576.     struct TextAttr *ITextFont;    /* if NULL, you accept the default */
  577.     UBYTE *IText;        /* pointer to null-terminated text */
  578.     struct IntuiText *NextText; /* pointer to another IntuiText to render */
  579. };
  580.  
  581.  
  582.  
  583.  
  584.  
  585.  
  586. /* ======================================================================== */
  587. /* === Border ============================================================= */
  588. /* ======================================================================== */
  589. /* Data type Border, used for drawing a series of lines which is intended for
  590.  *  use as a border drawing, but which may, in fact, be used to render any
  591.  *  arbitrary vector shape.
  592.  *  The routine DrawBorder sets up the RastPort with the appropriate
  593.  *  variables, then does a Move to the first coordinate, then does Draws
  594.  *  to the subsequent coordinates.
  595.  *  After all the Draws are done, if NextBorder is non-zero we call DrawBorder
  596.  *  on NextBorder
  597.  */
  598. struct Border
  599. {
  600.     WORD LeftEdge, TopEdge;    /* initial offsets from the origin */
  601.     UBYTE FrontPen, BackPen;    /* pens numbers for rendering */
  602.     UBYTE DrawMode;        /* mode for rendering */
  603.     BYTE Count;            /* number of XY pairs */
  604.     WORD *XY;            /* vector coordinate pairs rel to LeftTop */
  605.     struct Border *NextBorder;    /* pointer to any other Border too */
  606. };
  607.  
  608.  
  609.  
  610.  
  611.  
  612.  
  613. /* ======================================================================== */
  614. /* === Image ============================================================== */
  615. /* ======================================================================== */
  616. /* This is a brief image structure for very simple transfers of
  617.  * image data to a RastPort
  618.  */
  619. struct Image
  620. {
  621.     WORD LeftEdge;        /* starting offset relative to some origin */
  622.     WORD TopEdge;        /* starting offsets relative to some origin */
  623.     WORD Width;            /* pixel size (though data is word-aligned) */
  624.     WORD Height;
  625.     WORD Depth;            /* >= 0, for images you create        */
  626.     UWORD *ImageData;        /* pointer to the actual word-aligned bits */
  627.  
  628.     /* the PlanePick and PlaneOnOff variables work much the same way as the
  629.      * equivalent GELS Bob variables.  It's a space-saving
  630.      * mechanism for image data.  Rather than defining the image data
  631.      * for every plane of the RastPort, you need define data only
  632.      * for the planes that are not entirely zero or one.  As you
  633.      * define your Imagery, you will often find that most of the planes
  634.      * ARE just as color selectors.  For instance, if you're designing
  635.      * a two-color Gadget to use colors one and three, and the Gadget
  636.      * will reside in a five-plane display, bit plane zero of your
  637.      * imagery would be all ones, bit plane one would have data that
  638.      * describes the imagery, and bit planes two through four would be
  639.      * all zeroes.  Using these flags avoids wasting all
  640.      * that memory in this way:  first, you specify which planes you
  641.      * want your data to appear in using the PlanePick variable.  For
  642.      * each bit set in the variable, the next "plane" of your image
  643.      * data is blitted to the display.    For each bit clear in this
  644.      * variable, the corresponding bit in PlaneOnOff is examined.
  645.      * If that bit is clear, a "plane" of zeroes will be used.
  646.      * If the bit is set, ones will go out instead.  So, for our example:
  647.      *     Gadget.PlanePick = 0x02;
  648.      *     Gadget.PlaneOnOff = 0x01;
  649.      * Note that this also allows for generic Gadgets, like the
  650.      * System Gadgets, which will work in any number of bit planes.
  651.      * Note also that if you want an Image that is only a filled
  652.      * rectangle, you can get this by setting PlanePick to zero
  653.      * (pick no planes of data) and set PlaneOnOff to describe the pen
  654.      * color of the rectangle.
  655.      *
  656.      * NOTE:  Intuition relies on PlanePick to know how many planes
  657.      * of data are found in ImageData.    There should be no more
  658.      * '1'-bits in PlanePick than there are planes in ImageData.
  659.      */
  660.     UBYTE PlanePick, PlaneOnOff;
  661.  
  662.     /* if the NextImage variable is not NULL, Intuition presumes that
  663.      * it points to another Image structure with another Image to be
  664.      * rendered
  665.      */
  666.     struct Image *NextImage;
  667. };
  668.  
  669.  
  670.  
  671.  
  672.  
  673.  
  674. /* ======================================================================== */
  675. /* === IntuiMessage ======================================================= */
  676. /* ======================================================================== */
  677. struct IntuiMessage
  678. {
  679.     struct Message ExecMessage;
  680.  
  681.     /* the Class bits correspond directly with the IDCMP Flags, except for the
  682.      * special bit IDCMP_LONELYMESSAGE (defined below)
  683.      */
  684.     ULONG Class;
  685.  
  686.     /* the Code field is for special values like MENU number */
  687.     UWORD Code;
  688.  
  689.     /* the Qualifier field is a copy of the current InputEvent's Qualifier */
  690.     UWORD Qualifier;
  691.  
  692.     /* IAddress contains particular addresses for Intuition functions, like
  693.      * the pointer to the Gadget or the Screen
  694.      */
  695.     APTR IAddress;
  696.  
  697.     /* when getting mouse movement reports, any event you get will have the
  698.      * the mouse coordinates in these variables.  the coordinates are relative
  699.      * to the upper-left corner of your Window (WFLG_GIMMEZEROZERO
  700.      * notwithstanding).  If IDCMP_DELTAMOVE is set, these values will
  701.      * be deltas from the last reported position.
  702.      */
  703.     WORD MouseX, MouseY;
  704.  
  705.     /* the time values are copies of the current system clock time.  Micros
  706.      * are in units of microseconds, Seconds in seconds.
  707.      */
  708.     ULONG Seconds, Micros;
  709.  
  710.     /* the IDCMPWindow variable will always have the address of the Window of
  711.      * this IDCMP
  712.      */
  713.     struct Window *IDCMPWindow;
  714.  
  715.     /* system-use variable */
  716.     struct IntuiMessage *SpecialLink;
  717. };
  718.  
  719.  
  720. /* --- IDCMP Classes ------------------------------------------------------ */
  721. /* Please refer to the Autodoc for OpenWindow() and to the Rom Kernel
  722.  * Manual for full details on the IDCMP classes.
  723.  */
  724. #define IDCMP_SIZEVERIFY    0x00000001
  725. #define IDCMP_NEWSIZE        0x00000002
  726. #define IDCMP_REFRESHWINDOW    0x00000004
  727. #define IDCMP_MOUSEBUTTONS    0x00000008
  728. #define IDCMP_MOUSEMOVE        0x00000010
  729. #define IDCMP_GADGETDOWN    0x00000020
  730. #define IDCMP_GADGETUP        0x00000040
  731. #define IDCMP_REQSET        0x00000080
  732. #define IDCMP_MENUPICK        0x00000100
  733. #define IDCMP_CLOSEWINDOW    0x00000200
  734. #define IDCMP_RAWKEY        0x00000400
  735. #define IDCMP_REQVERIFY        0x00000800
  736. #define IDCMP_REQCLEAR        0x00001000
  737. #define IDCMP_MENUVERIFY    0x00002000
  738. #define IDCMP_NEWPREFS        0x00004000
  739. #define IDCMP_DISKINSERTED    0x00008000
  740. #define IDCMP_DISKREMOVED    0x00010000
  741. #define IDCMP_WBENCHMESSAGE    0x00020000  /*    System use only        */
  742. #define IDCMP_ACTIVEWINDOW    0x00040000
  743. #define IDCMP_INACTIVEWINDOW    0x00080000
  744. #define IDCMP_DELTAMOVE        0x00100000
  745. #define IDCMP_VANILLAKEY    0x00200000
  746. #define IDCMP_INTUITICKS    0x00400000
  747. /*  for notifications from "boopsi" gadgets    */
  748. #define IDCMP_IDCMPUPDATE    0x00800000  /* new for V36    */
  749. /* for getting help key report during menu session    */
  750. #define IDCMP_MENUHELP        0x01000000  /* new for V36    */
  751. /* for notification of any move/size/zoom/change window        */
  752. #define IDCMP_CHANGEWINDOW    0x02000000  /* new for V36    */
  753.  
  754. /* NOTEZ-BIEN:                0x80000000 is reserved for internal use   */
  755.  
  756. /* the IDCMP Flags do not use this special bit, which is cleared when
  757.  * Intuition sends its special message to the Task, and set when Intuition
  758.  * gets its Message back from the Task.  Therefore, I can check here to
  759.  * find out fast whether or not this Message is available for me to send
  760.  */
  761. #define IDCMP_LONELYMESSAGE    0x80000000
  762.  
  763.  
  764. /* --- IDCMP Codes -------------------------------------------------------- */
  765. /* This group of codes is for the IDCMP_MENUVERIFY function */
  766. #define MENUHOT        0x0001    /* IntuiWants verification or MENUCANCEL    */
  767. #define MENUCANCEL    0x0002    /* HOT Reply of this cancels Menu operation */
  768. #define MENUWAITING    0x0003    /* Intuition simply wants a ReplyMsg() ASAP */
  769.  
  770. /* These are internal tokens to represent state of verification attempts
  771.  * shown here as a clue.
  772.  */
  773. #define OKOK        MENUHOT    /* guy didn't care            */
  774. #define OKABORT        0x0004    /* window rendered question moot    */
  775. #define OKCANCEL    MENUCANCEL /* window sent cancel reply        */
  776.  
  777. /* This group of codes is for the IDCMP_WBENCHMESSAGE messages */
  778. #define WBENCHOPEN    0x0001
  779. #define WBENCHCLOSE    0x0002
  780.  
  781.  
  782. /* A data structure common in V36 Intuition processing    */
  783. struct IBox {
  784.     WORD Left;
  785.     WORD Top;
  786.     WORD Width;
  787.     WORD Height;
  788.     };
  789.  
  790.  
  791.  
  792. /* ======================================================================== */
  793. /* === Window ============================================================= */
  794. /* ======================================================================== */
  795. struct Window
  796. {
  797.     struct Window *NextWindow;        /* for the linked list in a screen */
  798.  
  799.     WORD LeftEdge, TopEdge;        /* screen dimensions of window */
  800.     WORD Width, Height;            /* screen dimensions of window */
  801.  
  802.     WORD MouseY, MouseX;        /* relative to upper-left of window */
  803.  
  804.     WORD MinWidth, MinHeight;        /* minimum sizes */
  805.     UWORD MaxWidth, MaxHeight;        /* maximum sizes */
  806.  
  807.     ULONG Flags;            /* see below for defines */
  808.  
  809.     struct Menu *MenuStrip;        /* the strip of Menu headers */
  810.  
  811.     UBYTE *Title;            /* the title text for this window */
  812.  
  813.     struct Requester *FirstRequest;    /* all active Requesters */
  814.  
  815.     struct Requester *DMRequest;    /* double-click Requester */
  816.  
  817.     WORD ReqCount;            /* count of reqs blocking Window */
  818.  
  819.     struct Screen *WScreen;        /* this Window's Screen */
  820.     struct RastPort *RPort;        /* this Window's very own RastPort */
  821.  
  822.     /* the border variables describe the window border.  If you specify
  823.      * WFLG_GIMMEZEROZERO when you open the window, then the upper-left of
  824.      * the ClipRect for this window will be upper-left of the BitMap (with
  825.      * correct offsets when in SuperBitMap mode; you MUST select
  826.      * WFLG_GIMMEZEROZERO when using SuperBitMap).  If you don't specify
  827.      * ZeroZero, then you save memory (no allocation of RastPort, Layer,
  828.      * ClipRect and associated Bitmaps), but you also must offset all your
  829.      * writes by BorderTop, BorderLeft and do your own mini-clipping to
  830.      * prevent writing over the system gadgets
  831.      */
  832.     BYTE BorderLeft, BorderTop, BorderRight, BorderBottom;
  833.     struct RastPort *BorderRPort;
  834.  
  835.  
  836.     /* You supply a linked-list of Gadgets for your Window.
  837.      * This list DOES NOT include system gadgets.  You get the standard
  838.      * window system gadgets by setting flag-bits in the variable Flags (see
  839.      * the bit definitions below)
  840.      */
  841.     struct Gadget *FirstGadget;
  842.  
  843.     /* these are for opening/closing the windows */
  844.     struct Window *Parent, *Descendant;
  845.  
  846.     /* sprite data information for your own Pointer
  847.      * set these AFTER you Open the Window by calling SetPointer()
  848.      */
  849.     UWORD *Pointer;    /* sprite data */
  850.     BYTE PtrHeight;    /* sprite height (not including sprite padding) */
  851.     BYTE PtrWidth;    /* sprite width (must be less than or equal to 16) */
  852.     BYTE XOffset, YOffset;    /* sprite offsets */
  853.  
  854.     /* the IDCMP Flags and User's and Intuition's Message Ports */
  855.     ULONG IDCMPFlags;    /* User-selected flags */
  856.     struct MsgPort *UserPort, *WindowPort;
  857.     struct IntuiMessage *MessageKey;
  858.  
  859.     UBYTE DetailPen, BlockPen;    /* for bar/border/gadget rendering */
  860.  
  861.     /* the CheckMark is a pointer to the imagery that will be used when
  862.      * rendering MenuItems of this Window that want to be checkmarked
  863.      * if this is equal to NULL, you'll get the default imagery
  864.      */
  865.     struct Image *CheckMark;
  866.  
  867.     UBYTE *ScreenTitle;    /* if non-null, Screen title when Window is active */
  868.  
  869.     /* These variables have the mouse coordinates relative to the
  870.      * inner-Window of WFLG_GIMMEZEROZERO Windows.  This is compared with the
  871.      * MouseX and MouseY variables, which contain the mouse coordinates
  872.      * relative to the upper-left corner of the Window, WFLG_GIMMEZEROZERO
  873.      * notwithstanding
  874.      */
  875.     WORD GZZMouseX;
  876.     WORD GZZMouseY;
  877.     /* these variables contain the width and height of the inner-Window of
  878.      * WFLG_GIMMEZEROZERO Windows
  879.      */
  880.     WORD GZZWidth;
  881.     WORD GZZHeight;
  882.  
  883.     UBYTE *ExtData;
  884.  
  885.     BYTE *UserData;    /* general-purpose pointer to User data extension */
  886.  
  887.     /** 11/18/85: this pointer keeps a duplicate of what
  888.      * Window.RPort->Layer is _supposed_ to be pointing at
  889.      */
  890.     struct Layer *WLayer;
  891.  
  892.     /* NEW 1.2: need to keep track of the font that
  893.      * OpenWindow opened, in case user SetFont's into RastPort
  894.      */
  895.     struct TextFont *IFont;
  896.  
  897.     /* (V36) another flag word (the Flags field is used up).
  898.      * At present, all flag values are system private.
  899.      * Until further notice, you may not change nor use this field.
  900.      */
  901.     ULONG    MoreFlags;
  902.  
  903.     /**** Data beyond this point are Intuition Private.  DO NOT USE ****/
  904. };
  905.  
  906.  
  907. /* --- Flags requested at OpenWindow() time by the application --------- */
  908. #define WFLG_SIZEGADGET        0x00000001    /* include sizing system-gadget? */
  909. #define WFLG_DRAGBAR        0x00000002    /* include dragging system-gadget? */
  910. #define WFLG_DEPTHGADGET    0x00000004    /* include depth arrangement gadget? */
  911. #define WFLG_CLOSEGADGET    0x00000008    /* include close-box system-gadget? */
  912.  
  913. #define WFLG_SIZEBRIGHT        0x00000010    /* size gadget uses right border */
  914. #define WFLG_SIZEBBOTTOM    0x00000020    /* size gadget uses bottom border */
  915.  
  916. /* --- refresh modes ------------------------------------------------------ */
  917. /* combinations of the WFLG_REFRESHBITS select the refresh type */
  918. #define WFLG_REFRESHBITS    0x000000C0
  919. #define WFLG_SMART_REFRESH  0x00000000
  920. #define WFLG_SIMPLE_REFRESH 0x00000040
  921. #define WFLG_SUPER_BITMAP   0x00000080
  922. #define WFLG_OTHER_REFRESH  0x000000C0
  923.  
  924. #define WFLG_BACKDROP        0x00000100    /* this is a backdrop window */
  925.  
  926. #define WFLG_REPORTMOUSE    0x00000200    /* to hear about every mouse move */
  927.  
  928. #define WFLG_GIMMEZEROZERO  0x00000400    /* a GimmeZeroZero window    */
  929.  
  930. #define WFLG_BORDERLESS        0x00000800    /* to get a Window sans border */
  931.  
  932. #define WFLG_ACTIVATE        0x00001000    /* when Window opens, it's Active */
  933.  
  934.  
  935. /* FLAGS SET BY INTUITION */
  936. #define WFLG_WINDOWACTIVE   0x00002000    /* this window is the active one */
  937. #define WFLG_INREQUEST        0x00004000    /* this window is in request mode */
  938. #define WFLG_MENUSTATE        0x00008000    /* Window is active with Menus on */
  939.  
  940. /* --- Other User Flags --------------------------------------------------- */
  941. #define WFLG_RMBTRAP        0x00010000    /* Catch RMB events for your own */
  942. #define WFLG_NOCAREREFRESH  0x00020000    /* not to be bothered with REFRESH */
  943.  
  944. /* --- Other Intuition Flags ---------------------------------------------- */
  945. #define WFLG_WINDOWREFRESH  0x01000000    /* Window is currently refreshing */
  946. #define WFLG_WBENCHWINDOW   0x02000000    /* WorkBench tool ONLY Window */
  947. #define WFLG_WINDOWTICKED   0x04000000    /* only one timer tick at a time */
  948.  
  949.  
  950. /* - V36 new Flags which the programmer may specify in NewWindow.Flags    */
  951. #define WFLG_NW_EXTENDED    0x00040000    /* extension data provided    */
  952.                     /* see struct ExtNewWindow    */
  953.  
  954. /* --- V36 Flags to be set only by Intuition -------------------------    */
  955. #define WFLG_VISITOR        0x08000000    /* visitor window        */
  956. #define WFLG_ZOOMED        0x10000000    /* identifies "zoom state"    */
  957. #define WFLG_HASZOOM        0x20000000    /* windowhas a zoom gadget    */
  958.  
  959. /* --- Other Window Values ---------------------------------------------- */
  960. #define DEFAULTMOUSEQUEUE    (5)    /* no more mouse messages    */
  961.  
  962. /* --- see struct IntuiMessage for the IDCMP Flag definitions ------------- */
  963.  
  964.  
  965.  
  966.  
  967. /* ======================================================================== */
  968. /* === NewWindow ========================================================== */
  969. /* ======================================================================== */
  970. /*
  971.  * Note that the new extension fields have been removed.  Use ExtNewWindow
  972.  * structure below to make use of these fields
  973.  */
  974. struct NewWindow
  975. {
  976.     WORD LeftEdge, TopEdge;        /* screen dimensions of window */
  977.     WORD Width, Height;            /* screen dimensions of window */
  978.  
  979.     UBYTE DetailPen, BlockPen;        /* for bar/border/gadget rendering */
  980.  
  981.     ULONG IDCMPFlags;            /* User-selected IDCMP flags */
  982.  
  983.     ULONG Flags;            /* see Window struct for defines */
  984.  
  985.     /* You supply a linked-list of Gadgets for your Window.
  986.      *    This list DOES NOT include system Gadgets.  You get the standard
  987.      *    system Window Gadgets by setting flag-bits in the variable Flags (see
  988.      *    the bit definitions under the Window structure definition)
  989.      */
  990.     struct Gadget *FirstGadget;
  991.  
  992.     /* the CheckMark is a pointer to the imagery that will be used when
  993.      * rendering MenuItems of this Window that want to be checkmarked
  994.      * if this is equal to NULL, you'll get the default imagery
  995.      */
  996.     struct Image *CheckMark;
  997.  
  998.     UBYTE *Title;              /* the title text for this window */
  999.  
  1000.     /* the Screen pointer is used only if you've defined a CUSTOMSCREEN and
  1001.      * want this Window to open in it.    If so, you pass the address of the
  1002.      * Custom Screen structure in this variable.  Otherwise, this variable
  1003.      * is ignored and doesn't have to be initialized.
  1004.      */
  1005.     struct Screen *Screen;
  1006.  
  1007.     /* WFLG_SUPER_BITMAP Window?  If so, put the address of your BitMap
  1008.      * structure in this variable.  If not, this variable is ignored and
  1009.      * doesn't have to be initialized
  1010.      */
  1011.     struct BitMap *BitMap;
  1012.  
  1013.     /* the values describe the minimum and maximum sizes of your Windows.
  1014.      * these matter only if you've chosen the WFLG_SIZEGADGET option,
  1015.      * which means that you want to let the User to change the size of
  1016.      * this Window.  You describe the minimum and maximum sizes that the
  1017.      * Window can grow by setting these variables.  You can initialize
  1018.      * any one these to zero, which will mean that you want to duplicate
  1019.      * the setting for that dimension (if MinWidth == 0, MinWidth will be
  1020.      * set to the opening Width of the Window).
  1021.      * You can change these settings later using SetWindowLimits().
  1022.      * If you haven't asked for a SIZING Gadget, you don't have to
  1023.      * initialize any of these variables.
  1024.      */
  1025.     WORD MinWidth, MinHeight;        /* minimums */
  1026.     UWORD MaxWidth, MaxHeight;         /* maximums */
  1027.  
  1028.     /* the type variable describes the Screen in which you want this Window to
  1029.      * open.  The type value can either be CUSTOMSCREEN or one of the
  1030.      * system standard Screen Types such as WBENCHSCREEN.  See the
  1031.      * type definitions under the Screen structure.
  1032.      */
  1033.     UWORD Type;
  1034.  
  1035. };
  1036.  
  1037. /* The following structure is the future NewWindow.  Compatibility
  1038.  * issues require that the size of NewWindow not change.
  1039.  * Data in the common part (NewWindow) indicates the the extension
  1040.  * fields are being used.
  1041.  * NOTE WELL: This structure may be subject to future extension.
  1042.  * Writing code depending on its size is not allowed.
  1043.  */
  1044. struct ExtNewWindow
  1045. {
  1046.     WORD LeftEdge, TopEdge;
  1047.     WORD Width, Height;
  1048.  
  1049.     UBYTE DetailPen, BlockPen;
  1050.     ULONG IDCMPFlags;
  1051.     ULONG Flags;
  1052.     struct Gadget *FirstGadget;
  1053.  
  1054.     struct Image *CheckMark;
  1055.  
  1056.     UBYTE *Title;
  1057.     struct Screen *Screen;
  1058.     struct BitMap *BitMap;
  1059.  
  1060.     WORD MinWidth, MinHeight;
  1061.     UWORD MaxWidth, MaxHeight;
  1062.  
  1063.     /* the type variable describes the Screen in which you want this Window to
  1064.      * open.  The type value can either be CUSTOMSCREEN or one of the
  1065.      * system standard Screen Types such as WBENCHSCREEN.  See the
  1066.      * type definitions under the Screen structure.
  1067.      * A new possible value for this field is PUBLICSCREEN, which
  1068.      * defines the window as a 'visitor' window.  See below for
  1069.      * additional information provided.
  1070.      */
  1071.     UWORD Type;
  1072.  
  1073.     /* ------------------------------------------------------- *
  1074.      * extensions for V36
  1075.      * if the NewWindow Flag value WFLG_NW_EXTENDED is set, then
  1076.      * this field is assumed to point to an array ( or chain of arrays)
  1077.      * of TagItem structures.  See also ExtNewScreen for another
  1078.      * use of TagItems to pass optional data.
  1079.      *
  1080.      * see below for tag values and the corresponding data.
  1081.      */
  1082.     struct TagItem    *Extension;
  1083. };
  1084.  
  1085. /*
  1086.  * The TagItem ID's (ti_Tag values) for OpenWindowTagList() follow.
  1087.  * They are values in a TagItem array passed as extension/replacement
  1088.  * values for the data in NewWindow.  OpenWindowTagList() can actually
  1089.  * work well with a NULL NewWindow pointer.
  1090.  */
  1091.  
  1092. #define WA_Dummy    (TAG_USER + 99)    /* 0x80000063    */
  1093.  
  1094. /* these tags simply override NewWindow parameters */
  1095. #define WA_Left            (WA_Dummy + 0x01)
  1096. #define WA_Top            (WA_Dummy + 0x02)
  1097. #define WA_Width        (WA_Dummy + 0x03)
  1098. #define WA_Height        (WA_Dummy + 0x04)
  1099. #define WA_DetailPen        (WA_Dummy + 0x05)
  1100. #define WA_BlockPen        (WA_Dummy + 0x06)
  1101. #define WA_IDCMP        (WA_Dummy + 0x07)
  1102.             /* "bulk" initialization of NewWindow.Flags */
  1103. #define WA_Flags        (WA_Dummy + 0x08)
  1104. #define WA_Gadgets        (WA_Dummy + 0x09)
  1105. #define WA_Checkmark        (WA_Dummy + 0x0A)
  1106. #define WA_Title        (WA_Dummy + 0x0B)
  1107.             /* means you don't have to call SetWindowTitles
  1108.              * after you open your window
  1109.              */
  1110. #define WA_ScreenTitle        (WA_Dummy + 0x0C)
  1111. #define WA_CustomScreen        (WA_Dummy + 0x0D)
  1112. #define WA_SuperBitMap        (WA_Dummy + 0x0E)
  1113.             /* also implies WFLG_SUPER_BITMAP property    */
  1114. #define WA_MinWidth        (WA_Dummy + 0x0F)
  1115. #define WA_MinHeight        (WA_Dummy + 0x10)
  1116. #define WA_MaxWidth        (WA_Dummy + 0x11)
  1117. #define WA_MaxHeight        (WA_Dummy + 0x12)
  1118.  
  1119. /* The following are specifications for new features    */
  1120.  
  1121. #define WA_InnerWidth        (WA_Dummy + 0x13)
  1122. #define WA_InnerHeight        (WA_Dummy + 0x14)
  1123.             /* You can specify the dimensions of the interior
  1124.              * region of your window, independent of what
  1125.              * the border widths will be.  You probably want
  1126.              * to also specify WA_AutoAdjust to allow
  1127.              * Intuition to move your window or even
  1128.              * shrink it so that it is completely on screen.
  1129.              */
  1130.  
  1131. #define WA_PubScreenName    (WA_Dummy + 0x15)
  1132.             /* declares that you want the window to open as
  1133.              * a visitor on the public screen whose name is
  1134.              * pointed to by (UBYTE *) ti_Data
  1135.              */
  1136. #define WA_PubScreen        (WA_Dummy + 0x16)
  1137.             /* open as a visitor window on the public screen
  1138.              * whose address is in (struct Screen *) ti_Data.
  1139.              * To ensure that this screen remains open, you
  1140.              * should either be the screen's owner, have a
  1141.              * window open on the screen, or use LockPubScreen().
  1142.              */
  1143. #define WA_PubScreenFallBack    (WA_Dummy + 0x17)
  1144.             /* A Boolean, specifies whether a visitor window
  1145.              * should "fall back" to the default public screen
  1146.              * (or Workbench) if the named public screen isn't
  1147.              * available
  1148.              */
  1149. #define WA_WindowName        (WA_Dummy + 0x18)
  1150.             /* not implemented    */
  1151. #define WA_Colors        (WA_Dummy + 0x19)
  1152.             /* a ColorSpec array for colors to be set
  1153.              * when this window is active.    This is not
  1154.              * implemented, and may not be, since the default
  1155.              * values to restore would be hard to track.
  1156.              * We'd like to at least support per-window colors
  1157.              * for the mouse pointer sprite.
  1158.              */
  1159. #define WA_Zoom        (WA_Dummy + 0x1A)
  1160.             /* ti_Data points to an array of four WORD's,
  1161.              * the initial Left/Top/Width/Height values of
  1162.              * the "alternate" zoom position/dimensions.
  1163.              * It also specifies that you want a Zoom gadget
  1164.              * for your window, whether or not you have a
  1165.              * sizing gadget.
  1166.              */
  1167. #define WA_MouseQueue        (WA_Dummy + 0x1B)
  1168.             /* ti_Data contains initial value for the mouse
  1169.              * message backlog limit for this window.
  1170.              */
  1171. #define WA_BackFill        (WA_Dummy + 0x1C)
  1172.             /* unimplemented at present: provides a "backfill
  1173.              * hook" for your window's layer.
  1174.              */
  1175. #define WA_RptQueue        (WA_Dummy + 0x1D)
  1176.             /* initial value of repeat key backlog limit    */
  1177.  
  1178.     /* These Boolean tag items are alternatives to the NewWindow.Flags
  1179.      * boolean flags with similar names.
  1180.      */
  1181. #define WA_SizeGadget        (WA_Dummy + 0x1E)
  1182. #define WA_DragBar        (WA_Dummy + 0x1F)
  1183. #define WA_DepthGadget        (WA_Dummy + 0x20)
  1184. #define WA_CloseGadget        (WA_Dummy + 0x21)
  1185. #define WA_Backdrop        (WA_Dummy + 0x22)
  1186. #define WA_ReportMouse        (WA_Dummy + 0x23)
  1187. #define WA_NoCareRefresh    (WA_Dummy + 0x24)
  1188. #define WA_Borderless        (WA_Dummy + 0x25)
  1189. #define WA_Activate        (WA_Dummy + 0x26)
  1190. #define WA_RMBTrap        (WA_Dummy + 0x27)
  1191. #define WA_WBenchWindow        (WA_Dummy + 0x28)    /* PRIVATE!! */
  1192. #define WA_SimpleRefresh    (WA_Dummy + 0x29)
  1193.             /* only specify if TRUE    */
  1194. #define WA_SmartRefresh        (WA_Dummy + 0x2A)
  1195.             /* only specify if TRUE    */
  1196. #define WA_SizeBRight        (WA_Dummy + 0x2B)
  1197. #define WA_SizeBBottom        (WA_Dummy + 0x2C)
  1198.  
  1199.     /* New Boolean properties    */
  1200. #define WA_AutoAdjust        (WA_Dummy + 0x2D)
  1201.             /* shift or squeeze the window's position and
  1202.              * dimensions to fit it on screen.
  1203.              */
  1204.  
  1205. #define WA_GimmeZeroZero    (WA_Dummy + 0x2E)
  1206.             /* equiv. to NewWindow.Flags WFLG_GIMMEZEROZERO    */
  1207.  
  1208. /* New for V37: WA_MenuHelp (ignored by V36) */
  1209. #define WA_MenuHelp        (WA_Dummy + 0x2F)
  1210.             /* Enables IDCMP_MENUHELP:  Pressing HELP during menus
  1211.              * will return IDCMP_MENUHELP message.
  1212.              */
  1213.  
  1214.  
  1215.  
  1216. #ifndef INTUITION_SCREENS_H
  1217. #include <intuition/screens.h>
  1218. #endif
  1219.  
  1220. #ifndef INTUITION_PREFERENCES_H
  1221. #include <intuition/preferences.h>
  1222. #endif
  1223.  
  1224. /* ======================================================================== */
  1225. /* === Remember =========================================================== */
  1226. /* ======================================================================== */
  1227. /* this structure is used for remembering what memory has been allocated to
  1228.  * date by a given routine, so that a premature abort or systematic exit
  1229.  * can deallocate memory cleanly, easily, and completely
  1230.  */
  1231. struct Remember
  1232. {
  1233.     struct Remember *NextRemember;
  1234.     ULONG RememberSize;
  1235.     UBYTE *Memory;
  1236. };
  1237.  
  1238.  
  1239. /* === Color Spec ====================================================== */
  1240. /* How to tell Intuition about RGB values for a color table entry. */
  1241. struct ColorSpec {
  1242.     WORD    ColorIndex;    /* -1 terminates an array of ColorSpec    */
  1243.     UWORD    Red;        /* only 6 bits recognized in V36    */
  1244.     UWORD    Green;        /* only 6 bits recognized in V36    */
  1245.     UWORD    Blue;        /* only 6 bits recognized in V36    */
  1246. };
  1247.  
  1248. /* === Easy Requester Specification ======================================= */
  1249. /* see also autodocs for EasyRequest and BuildEasyRequest    */
  1250. /* NOTE: This structure may grow in size in the future        */
  1251. struct EasyStruct {
  1252.     ULONG    es_StructSize;    /* should be sizeof (struct EasyStruct )*/
  1253.     ULONG    es_Flags;    /* should be 0 for now            */
  1254.     UBYTE    *es_Title;    /* title of requester window        */
  1255.     UBYTE    *es_TextFormat;    /* 'printf' style formatting string    */
  1256.     UBYTE    *es_GadgetFormat; /* 'printf' style formatting string    */
  1257. };
  1258.  
  1259.  
  1260.  
  1261. /* ======================================================================== */
  1262. /* === Miscellaneous ====================================================== */
  1263. /* ======================================================================== */
  1264.  
  1265. /* = MACROS ============================================================== */
  1266. #define MENUNUM(n) (n & 0x1F)
  1267. #define ITEMNUM(n) ((n >> 5) & 0x003F)
  1268. #define SUBNUM(n) ((n >> 11) & 0x001F)
  1269.  
  1270. #define SHIFTMENU(n) (n & 0x1F)
  1271. #define SHIFTITEM(n) ((n & 0x3F) << 5)
  1272. #define SHIFTSUB(n) ((n & 0x1F) << 11)
  1273.  
  1274. #define FULLMENUNUM( menu, item, sub )    \
  1275.     ( SHIFTSUB(sub) | SHIFTITEM(item) | SHIFTMENU(menu) )
  1276.  
  1277. #define SRBNUM(n)    (0x08 - (n >> 4))    /* SerRWBits -> read bits per char */
  1278. #define SWBNUM(n)    (0x08 - (n & 0x0F))/* SerRWBits -> write bits per chr */
  1279. #define SSBNUM(n)    (0x01 + (n >> 4))    /* SerStopBuf -> stop bits per chr */
  1280. #define SPARNUM(n)   (n >> 4)        /* SerParShk -> parity setting      */
  1281. #define SHAKNUM(n)   (n & 0x0F)    /* SerParShk -> handshake mode      */
  1282.  
  1283.  
  1284. /* = MENU STUFF =========================================================== */
  1285. #define NOMENU 0x001F
  1286. #define NOITEM 0x003F
  1287. #define NOSUB  0x001F
  1288. #define MENUNULL 0xFFFF
  1289.  
  1290.  
  1291. /* = =RJ='s peculiarities ================================================= */
  1292. #define FOREVER for(;;)
  1293. #define SIGN(x) ( ((x) > 0) - ((x) < 0) )
  1294. #define NOT !
  1295.  
  1296. /* these defines are for the COMMSEQ and CHECKIT menu stuff.  If CHECKIT,
  1297.  * I'll use a generic Width (for all resolutions) for the CheckMark.
  1298.  * If COMMSEQ, likewise I'll use this generic stuff
  1299.  */
  1300. #define CHECKWIDTH    19
  1301. #define COMMWIDTH    27
  1302. #define LOWCHECKWIDTH    13
  1303. #define LOWCOMMWIDTH    16
  1304.  
  1305.  
  1306. /* these are the AlertNumber defines.  if you are calling DisplayAlert()
  1307.  * the AlertNumber you supply must have the ALERT_TYPE bits set to one
  1308.  * of these patterns
  1309.  */
  1310. #define ALERT_TYPE    0x80000000
  1311. #define RECOVERY_ALERT    0x00000000    /* the system can recover from this */
  1312. #define DEADEND_ALERT    0x80000000    /* no recovery possible, this is it */
  1313.  
  1314.  
  1315. /* When you're defining IntuiText for the Positive and Negative Gadgets
  1316.  * created by a call to AutoRequest(), these defines will get you
  1317.  * reasonable-looking text.  The only field without a define is the IText
  1318.  * field; you decide what text goes with the Gadget
  1319.  */
  1320. #define AUTOFRONTPEN    0
  1321. #define AUTOBACKPEN    1
  1322. #define AUTODRAWMODE    JAM2
  1323. #define AUTOLEFTEDGE    6
  1324. #define AUTOTOPEDGE    3
  1325. #define AUTOITEXTFONT    NULL
  1326. #define AUTONEXTTEXT    NULL
  1327.  
  1328.  
  1329. /* --- RAWMOUSE Codes and Qualifiers (Console OR IDCMP) ------------------- */
  1330. #define SELECTUP    (IECODE_LBUTTON | IECODE_UP_PREFIX)
  1331. #define SELECTDOWN    (IECODE_LBUTTON)
  1332. #define MENUUP        (IECODE_RBUTTON | IECODE_UP_PREFIX)
  1333. #define MENUDOWN    (IECODE_RBUTTON)
  1334. #define MIDDLEDOWN    (IECODE_MBUTTON)
  1335. #define MIDDLEUP    (IECODE_MBUTTON | IECODE_UP_PREFIX)
  1336. #define ALTLEFT        (IEQUALIFIER_LALT)
  1337. #define ALTRIGHT    (IEQUALIFIER_RALT)
  1338. #define AMIGALEFT    (IEQUALIFIER_LCOMMAND)
  1339. #define AMIGARIGHT    (IEQUALIFIER_RCOMMAND)
  1340. #define AMIGAKEYS    (AMIGALEFT | AMIGARIGHT)
  1341.  
  1342. #define CURSORUP    0x4C
  1343. #define CURSORLEFT    0x4F
  1344. #define CURSORRIGHT    0x4E
  1345. #define CURSORDOWN    0x4D
  1346. #define KEYCODE_Q    0x10
  1347. #define KEYCODE_Z    0x31
  1348. #define KEYCODE_X    0x32
  1349. #define KEYCODE_V    0x34
  1350. #define KEYCODE_B    0x35
  1351. #define KEYCODE_N    0x36
  1352. #define KEYCODE_M    0x37
  1353. #define KEYCODE_LESS    0x38
  1354. #define KEYCODE_GREATER 0x39
  1355.  
  1356. /* Include obsolete identifiers: */
  1357. #ifndef INTUITION_IOBSOLETE_H
  1358. #include <intuition/iobsolete.h>
  1359. #endif
  1360.  
  1361. #endif
  1362.